package com.buding.fx.service.impl;

import com.buding.fx.common.constant.CssStyleInfo;
import com.buding.fx.common.enums.ButtonTypeEnum;
import com.buding.fx.entity.Menu;
import com.buding.fx.entity.SystemConfigInfo;
import com.buding.fx.service.CenterPageBuildService;
import com.buding.fx.utils.ButtonUtils;
import javafx.geometry.Pos;
import javafx.scene.Node;
import javafx.scene.control.Button;
import javafx.scene.image.Image;
import javafx.scene.image.ImageView;
import javafx.scene.layout.*;
import javafx.scene.paint.Color;
import javafx.scene.text.Font;
import sun.font.FontFamily;

import java.awt.*;
import java.util.ArrayList;
import java.util.List;

/**
 * @author mingdongwei-jwk
 * @date 2022/09/30 14:39
 * @class com.buding.fx.service.impl
 * @Description
 */
public class WebScManagerBuildService extends BasePageBuildSerivce implements CenterPageBuildService {


    @Override
    public Node buildTopNode(Menu menu, SystemConfigInfo configInfo) {
        return addTitle(configInfo.getCss(),menu.getPath());
    }

    @Override
    public Node buildSearchNode(Menu menu, SystemConfigInfo configInfo) {
        //构建默认的搜索框
        Node node =  addSearchNode(menu,configInfo.getCss());
        if (node!=null){
            FlowPane flowPane = (FlowPane) node;
            Button clearButton = ButtonUtils.createButton(ButtonTypeEnum.ADD, "增加");
            Button searchButton = ButtonUtils.createButton(ButtonTypeEnum.SEARCH, "搜索");
            flowPane.getChildren().add(clearButton);
            flowPane.getChildren().add(searchButton);
            Border border = new Border(new BorderStroke(Color.web("#A2BEE2"), BorderStrokeStyle.SOLID,null,new BorderWidths(1,1,1,1)));
            flowPane.setBorder(border);
        }
        return node;
    }

    @Override
    public Node bulidSerchResultNode(Menu menu, SystemConfigInfo configInfo) {

        return null;
    }
}
